import { Controller, Get } from '@nestjs/common';
import { CustomDecoratorService } from './custom-decorator.service';
import {
  MergeDecorator,
  MyHeaders,
  MyQuery,
} from 'src/decorator/custom-decorator.decorator';
import { LoginGuard } from 'src/guard/login.guard';

@Controller('api/custom-decorator')
export class CustomDecoratorController {
  constructor(
    private readonly customDecoratorService: CustomDecoratorService,
  ) {}

  @MergeDecorator('Admin', LoginGuard)
  mergeDecorator() {
    return this.customDecoratorService.findAll();
  }

  @Get('/myHeaders')
  myHeader(@MyHeaders() myHeaders) {
    return myHeaders;
  }

  @Get('/myQuery')
  myQuery(@MyQuery('aaa') aaa: string) {
    return aaa;
  }
}
